import { RouteRecordRaw } from "vue-router";

const routes: RouteRecordRaw[] = [
    {
        path: "/",
        redirect: "/index",
        name: "重定向",
    },
    {
        path: "/index",
        name: "首页",
        component: () => import("@/views/index.vue"),
    },
    {
        path: "/login",
        name: "登入页",
        component: () => import("@/views/Login/index.vue"),
    },
    {
        path: "/contests",
        name: "竞赛",
        component: () => import("@/views/Contests/index.vue"),
    },
    {
        path: "/course",
        name: "课程",
        component: () => import("@/views/Course/index.vue"),
    },
    {
        path: "/events",
        name: "活动",
        component: () => import("@/views/Events/index.vue"),
    },
    {
        path: "/article",
        name: "文章",
        component: () => import("@/views/article/index.vue"),
    },
    {
        path: "/article-details",
        name: "文章详情",
        component: () => import("@/views/article/details.vue"),
    },
    {
        path: "/message",
        name: "消息页",
        // @ts-ignore
        component: () => import("@/views/Message/index.vue"),
    },
    {
        path: "/book",
        name: "图书页",
        component: () => import("@/views/Book/index.vue"),
    },
    {
        path: "/practice",
        name: "实习",
        component: () => import("@/views/Practice/index.vue"),
    },
    {
        path: "/q-bank",
        name: "题库",
        component: () => import("@/views/QBank/index.vue"),
    },
    {
        path: "/my",
        name: "我的",
        component: () => import("@/views/My/index.vue"),
        redirect: "/my/part-in-contest",
        children: [
            {
                path: "part-in-contest",
                name: "我的竞赛",
                component: () => import("@/views/My/PartInContest/index.vue"),
            },
            {
                path: "part-in-events",
                name: "我的活动",
                component: () => import("@/views/My/PartInEvents/index.vue"),
            },
            {
                path: "part-in-blog",
                name: "我的文章",
                component: () => import("@/views/My/PartInBlog/index.vue"),
            },
        ],
    },
    {
        path: "/contest-details",
        name: "竞赛详情页",
        component: () => import("@/views/Contests/details.vue"),
    },
    {
        path: "/events-details",
        name: "活动详情页",
        component: () => import("@/views/Events/details.vue"),
    },
    {
        path: "/publish-contest",
        name: "发布竞赛",
        component: () => import("@/views/PublishContest/index.vue"),
    },
    {
        path: "/redact-user-info",
        name: "修改用户信息",
        component: () => import("@/views/RedactUserInfo/index.vue"),
    },
    {
        path: "/publish-events",
        name: "发布活动",
        component: () => import("@/views/PublishEvents/index.vue"),
    },
    {
        path: "/application",
        name: "报名",
        component: () => import("@/views/Application/index.vue"),
    },
    {
        path: "/applicationInfo",
        name: "报名信息",
        component: () => import("@/views/ApplicationInfo/index.vue"),
    },
    {
        path: "/addOrUpdataArticle",
        name: "发布或修改文章",
        component: () => import("@/views/article/addOrUpdataArticle.vue"),
    },
];

export default routes;
